<extend name="./Apps/Home/View/default/users/layout.html" />
<block name="content">
<style>
.ATRoot{padding:0px 5px;height:22px;line-height:22px;clear:both;}
.ATNode{margin-right:5px;;line-height:22px;width:150px;float:left;}
label{cursor:pointer;}
.Hide{display:none;}
dl.areaSelect{display: inline-block; width:100%; margin-bottom: 0;/*border:1px solid #eee;*/}
dl.areaSelect:hover{border:1px solid #E5CD29;}
dl.areaSelect:hover dd{display: block;}
dl.areaSelect dd{margin-left:20px;width:100%;}
.layui-layer-btn a{background:#e23c3d;}
.abtn {
    background: #f4f4f4 none repeat scroll 0 0;
    border: 1px solid #dddddd;
    color: #333;
    display: inline-block;
    height: 30px;
    line-height: 30px;
    margin-top: 0;
    padding: 0;
    text-align: center;
    text-decoration: none;
    width: 106px;
}

</style>
<script src="__PUBLIC__/plugins/kindeditor/kindeditor.js"></script>
<script src="__PUBLIC__/plugins/kindeditor/lang/zh-CN.js"></script>
   <script>
   	var relateCommunity = "{$object['relateCommunity']}".split(',');
   	var relateArea = "{$object['relateArea']}".split(',');

   	$(function () {
   		
   		userShopInit();
   		getAreas("areaId2",'{$object["areaId1"]}',"{$object['areaId2']}","areaId2,areaId3",function(){
   			getCommunityForOpen();
 		    getAreas("areaId3",'{$object["areaId2"]}','{$object["areaId3"]}',"areaId3");
 	    });
   		$('#areaId1').change(function(){
   			getAreas("areaId2",$(this).val(),"","areaId2,areaId3");
   		});
   		$('#areaId2').change(function(){
   			getAreas("areaId3",$(this).val(),"","areaId3");
   			getCommunityForOpen();
   		});
   		$("input[name='isDistributAll']").click(function(){
 		   if($(this).val()==1){
 			   $("#delivery_tr").hide();
 		   }else{
 			   $("#delivery_tr").show();
 		   }
 	   });
    });

   </script>	
   <div class="wst-body"> 
       <div class='wst-page-header'>买家中心 > 我要开店</div>
       <div class='wst-page-content' style="position:relative;">
       <form name="myshop" method="post" id="myshop" autocomplete="off">
        <input type='hidden' id='id' value='{$object.shopId}'/>
        <table class="table table-hover table-striped table-bordered wst-form">
           <tr>
             <th width='130' align='right'>店铺名称<font color='red'>*</font>：</th>
             <td><input type='text' id='shopName' name='shopName' value='{$object.shopName}' class="wstipt" style='width:250px;' maxLength='25'/></td>
           </tr>
           <tr>
             <th width='120' align='right'>店主姓名<font color='red'>*</font>：</th>
             <td><input type='text' id='userName' class="wstipt" style='width:250px;' maxLength='25' value='{$object.userName}'/></td>
           </tr>
           <tr>
             <th width='120' align='right'>公司名称<font color='red'>*</font>：</th>
             <td><input type='text' id='shopCompany' class="wstipt"  style='width:250px;' maxLength='25' value='{$object.shopCompany}'/></td>
           </tr>
           <tr>
             <th width='120' align='right'>店铺图标<font color='red'>*</font>：</th>
             <td>
                <div>
             	    <div id="filePicker" style='margin-left:0px;float:left'>上传店铺图标</div>
             	    <div style='margin-left:5px;float:left'>图片大小:150 x 150 (px)，格式为 gif, jpg, jpeg, png</div>
             	</div>
             	<div style='clear:both;'>
             	<if condition="$object['shopImg'] !='' ">
	             		<img height="100" id='preview' class='lazyImg' data-original='__ROOT__/{$object.shopImg}'>
	            <else/>
                <img id='preview' src='' ref='' width='100' height='100' style='display:none'/> 
                </if>
                <input id="shopImg" name="shopImg" class="text wstipt" tabindex="3" autocomplete="off" style="" type="hidden" value="{$object.shopImg}"/>
                </div>
             </td>
           </tr>
           
           <tr>
             <th width='120' align='right'>店铺电话<font color='red'>*</font>：</th>
             <td><input type='text' id='shopTel' class="wstipt" maxLength='25' value='{$object.shopTel}'/></td>
           </tr>
           <tr>
             <th width='120' align='right'>QQ：</th>
             <td><input type='text' id='qqNo' class="wstipt" maxLength='25' value='{$object.qqNo}'/></td>
           </tr>
           <tr>
             <th width='120' align='right'>所属地区<font color='red'>*</font>：</th>
             <td>
             <select id='areaId1' class='wstipt'>
               <option value=''>请选择</option>
               <volist name="areaList" id="vo">
               <option value='{$vo['areaId']}' <if condition="$object['areaId1'] == $vo['areaId'] ">selected</if>>{$vo['areaName']}</option>
               </volist>
             </select>
             <select id='areaId2' class='wstipt'>
               <option value=''>请选择</option>
             </select>
             <select id='areaId3' class='wstipt'>
               <option value=''>请选择</option>
             </select>
             </td>
           </tr>
           <tr>
             <th width='120' align='right'>店铺地址<font color='red'>*</font>：</th>
             <td><input type='text' id='shopAddress' class="wstipt" style='width:350px;' maxLength='100' value='{$object.shopAddress}'/></td>
           </tr>
           <tr id='shopMap' style='display:none'>
             <td width='120'>&nbsp;</td>
             <td  width='860'>
             <div id="mapContainer" style='height:400px;width:90%;'>等待地图初始化...</div>
             <div style='display:none'>
	             <input type='hidden' id='latitude' name='latitude' class="wstipt" value="{$object['latitude']}"/>
	             <input type='hidden' id='longitude' name='longitude' class="wstipt" value="{$object['longitude']}"/>
	             <input type='hidden' id='mapLevel' name='mapLevel' class="wstipt" value="{$object['mapLevel']}"/>
             </div>
             <div style='color:red'>(注意：提交开店申请之后店铺地址将无法修改)</div>
             </td>
           </tr>
           <tr>
             <th align='right'>所属行业<font color='red'>*</font>：</th>
             <td>
             <select id='goodsCatId1' class='wstipt'>
                <option value=''>请选择</option>
                <volist name="goodsCatsList" id="vo">
                <option value='{$vo['catId']}' <if condition="$object['goodsCatId1'] == $vo['catId'] ">selected</if>>{$vo['catName']}</option>
                </volist>
             </select>
             </td>
           </tr>
           <tr>
             <th align='right'>营业状态<font color='red'>*</font>：</th>
             <td>
             <label>
             <input type='radio' id='shopAtive1' name='shopAtive' value='1' <if condition="$object['shopAtive'] ==1 ">checked</if> class='wstipt'/>营业中&nbsp;&nbsp;
             </label>
             <label>
             <input type='radio' id='shopAtive0' name='shopAtive' value='0' <if condition="$object['shopAtive'] !=1 ">checked</if> class='wstipt'/>休息中
             </label>
             </td>
           </tr>
           <tr>
             <th align='right'>配送范围<font color='red'>*</font>：</th>
             <td>
             <label>
             <input type='radio' name='isDistributAll' class='wstipt' value='0' <if condition="$object['isDistributAll'] ==0 ">checked</if> />区域配送&nbsp;&nbsp;
             </label>
             <label>
             <input type='radio' name='isDistributAll' class='wstipt' value='1' <if condition="$object['isDistributAll'] ==1 ">checked</if> />全国配送
             </label>
             </td>
           </tr>
           <tr id="delivery_tr" style="display: {$object['isDistributAll'] ==1?'none':''}">
             <th width='120' align='right'>配送区域<font color='red'>*</font>：</th>
             <td>
             <div class="text-gray Hide">展开全部：<input type="checkbox" id="expendAll" <if condition="$WST_USER['isSelf'] == 1">disabled</if>></div>
             <div id='areaTree'>
             </div>
             </td>
           </tr>
           <tr>
             <th width='120' align='right'>订单配送起步价<font color='red'>*</font>：</th>
             <td><input type="text" id="deliveryStartMoney" class="wstipt" value='{$object.deliveryStartMoney}' onkeypress="return WST.isNumberdoteKey(event)" onkeyup="javascript:WST.isChinese(this,1)" maxlength="8"></td>
           </tr>
           <tr>
             <th width='120' align='right'>包邮起步价<font color='red'>*</font>：</th>
             <td><input type='text' id='deliveryFreeMoney' class="wstipt" value='{$object.deliveryFreeMoney}' onkeypress="return WST.isNumberdoteKey(event)" onkeyup="javascript:WST.isChinese(this,1)" maxLength='8'/></td>
           </tr>
           <tr>
             <th width='120' align='right'>邮费<font color='red'>*</font>：</th>
             <td><input type='text' id='deliveryMoney' class="wstipt" value='{$object.deliveryMoney}' onkeypress="return WST.isNumberdoteKey(event)" onkeyup="javascript:WST.isChinese(this,1)" maxLength='8'/></td>
           </tr>
           <tr>
             <th width='120' align='right'>平均配送时间<font color='red'>*</font>：</th>
             <td><input type='text' id='deliveryCostTime' class="wstipt" value='{$object.deliveryCostTime}' onkeypress="return WST.isNumberKey(event)" onkeyup="javascript:WST.isChinese(this,1)" maxLength='8'/></td>
           </tr>
           <tr>
             <th width='120' align='right'>平均消费金额<font color='red'>*</font>：</th>
             <td><input type='text' id='avgeCostMoney' class="wstipt" value='{$object.avgeCostMoney}' onkeypress="return WST.isNumberdoteKey(event)" onkeyup="javascript:WST.isChinese(this,1)" maxLength='8'/></td>
           </tr>
           <tr>
             <th align='right'>能否开发票<font color='red'>*</font>：</th>
             <td>
             <label>
             <input type='radio' id='isInvoice1' class='wstipt' onclick="javascript:WST.showHide(1,'#invoiceRemarkstr')" name='isInvoice' value='1' <if condition="$object['isInvoice'] ==1 ">checked</if>/>能&nbsp;&nbsp;
             </label>
             <label>
             <input type='radio' id='isInvoice0' class='wstipt' onclick="javascript:WST.showHide(0,'#invoiceRemarkstr')" name='isInvoice' value='0' <if condition="$object['isInvoice'] !=1 ">checked</if>/>否
             </label>
             </td>
           </tr>
           <tr id='invoiceRemarkstr' <if condition="$object['isInvoice'] ==0 ">style='display:none'</if>>
             <th width='120' align='right'>发票说明：</th>
             <td><input type='text' id='invoiceRemarks' class="wstipt" value='{$object.invoiceRemarks}' style='width:350px;' maxLength='100'/></td>
           </tr>
           <tr>
             <th width='120' align='right'>转账银行<font color='red'>*</font>：</th>
             <td>
             <select id='bankId' class='wstipt'>
                <option value=''>请选择</option>
                <volist name="bankList" id="vo">
                <option <if condition="$vo['bankId'] eq $object['bankId']">selected</if> value='{$vo['bankId']}'>{$vo['bankName']}</option>
                </volist>
             </select>
             </td>
           </tr>
           <tr>
             <th width='120' align='right'>银行卡卡号<font color='red'>*</font>：</th>
             <td><input type='text' id='bankNo' maxLength='25' class='wstipt' size='50' value='{$object.bankNo}'/></td>
           </tr>
           <tr>
             <th width='120' align='right'>银行卡所有人名称<font color='red'>*</font>：</th>
             <td><input type="text" class='text wstipt' id="bankUserName" maxlength="25" size="50" value='{$object.bankUserName}'></td>
           </tr>
           
           <tr>
             <th width='120' align='right'>营业时间<font color='red'>*</font>：</th>
             <td>
             <select id='serviceStartTime' class='wstipt'></select>
             至
             <select id='serviceEndTime' class='wstipt'></select>
             </td>
           </tr>
           <tr>
             <th align='right'>手机号<font color='red'>*</font>：</th>
             <td>
             <input id="userPhone" name="userPhone" class="wstipt" value="{$object.userPhone}" autocomplete="off" maxlength="11" type="text"/>
	         <label class="blank invisible"></label>
             </td>
           </tr>
           <if condition="$CONF['phoneVerfy'] eq 1">
           <tr>
             <th align='right'>验证码<font color='red'>*</font>：</th>
             <td>
             <input id="mobileCode" style="ime-mode:disabled" name="mobileCode" class="wstipt" tabindex="6" autocomplete="off" maxlength="6" type="text"/>
             <a class="abtn" href="javascript:void(0);" onclick="getVerifyCode();" id="sendMobileCode">
	             <span id="timeTips">获取短信验证码</span>
	         </a>
             </td>
           </tr>
           <else/>
           <tr>
             <th align='right'>验证码<font color='red'>*</font>：</th>
             <td>
             <input id="verify" style="ime-mode:disabled" name="verify" class="text text-1 wstipt" tabindex="6" autocomplete="off" maxlength="6" type="text"/>
	         <label class="img">
	            <img style='vertical-align:middle;cursor:pointer;height:30px;' class='verifyImg' title='刷新验证码' onclick='javascript:getVerify()'/> 
			 </label>      	
	         <label class="ftx23">&nbsp;看不清？<a href="javascript:getVerify()" class="flk13">换一张</a></label>
             </td>
           </tr>
           </if>
           <tr>
             <th>&nbsp;</th>
             <td>
             <label>
	           <input class="checkbox" id="protocol" name="protocol" type="checkbox"/>
	                                 我已阅读并同意</label><a href="javascript:;" class="blue" id="protocolInfo" onclick="showXiey();">《店铺用户注册协议》</a>                       
	         <label id="protocol_error" class="error hide">请接受服务条款</label>
             </td>
           </tr>
           <tr>
             <td colspan='2' style='padding-left:320px;'>
                 <button class='wst-btn-query' type="submit">保&nbsp;存</button>
                 <button class='wst-btn-query' type="button" onclick='javascript:location.reload();'>重&nbsp;置</button>
             </td>
           </tr>
        </table>
       </form>
       </div>
   </div>
   <script src="__ROOT__/Apps/Home/View/{$WST_STYLE}/js/open_shop.js"></script>
   <script type="text/javascript" src="http://webapi.amap.com/maps?v=1.3&key=37f0869604ca86505487639427d52bf6"></script>
</block>  
